﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class TestWrite : EOS.Security.PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void ButtonTestWrite_Click(object sender, EventArgs e)
    {
        string path = Request.PhysicalApplicationPath;
        string filename = path + "test.txt";
        try
        {
            System.IO.FileStream stream = new System.IO.FileStream(filename, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write);
            byte[] content  = System.Text.ASCIIEncoding.ASCII.GetBytes("Hello world!");
            stream.Write(content, 0, content.Length);
            stream.Close();
            this.LabelErrorMessage.Text="Success write!";
        }
        catch (Exception exp)
        {
            base.ShowError(exp.ToString());
        }
    }
}
